﻿using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _03Net8Logging.Application
{
    public class OrderService
    {
		private ILogger<OrderService> _logger;

        public OrderService(ILogger<OrderService> logger)
        {
            _logger = logger;
        }

        public void GetOrder()
        {
			try
			{
                _logger.LogInformation("添加订单");

                throw new Exception("添加订单报错"); 
			}
			catch (Exception ex)
			{
                _logger.LogError(ex.Message);
            }
        }
    }
}
